<template>
  <ul class="hot">
    <li v-for="item in hotlist" :key="item.id" @click="goItem(item.id)">
      <div class="item-img">
        <img :src="item.img" />
      </div>
      <div class="item-text">
        <div class="item-l">
          <div>
            <span>{{ item.nm }}</span>
            <img
              v-if="item.ver.indexOf('IMAX 2D') !== -1"
              src="https://s0.meituan.net/bs/myfe/canary/file/touchnode/images/dpmmweb/hot-tab/img/base64/v2dimax.png"
            />
          </div>
          <div>
            <span v-if="item.mk == 0">暂无评分</span
            ><span v-else
              >观众评 <span class="score">{{ item.mk }}</span></span
            >
          </div>
          <div>{{ item.desc }}</div>
          <div>{{ item.showInfo }}</div>
        </div>
        <div class="item-r">
          <div
            class="btn"
            :style="
              item.preSale
                ? { background: '#3C9FE6' }
                : { background: '#f03d37' }
            "
          >
            {{ item.preSale ? "预售" : "购票" }}
          </div>
        </div>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  name: "MovieHot",
  props: ["hotlist"],
  methods: {
    goItem(id) {
      this.$router.push("/movieitem/" + id);
    },
  },
};
</script>

<style lang="less" scoped>
.hot {
  li:last-child {
    .item-text {
      border-bottom: none;
    }
  }
  li {
    display: flex;
    justify-content: space-around;
    padding: 5px;
    .item-img {
      width: 20%;

      img {
        width: 1.7067rem;
        height: 2.4rem;
        display: inline-block;
        // padding-left: 0.2667rem;
      }
    }
    .item-text {
      width: 75%;
      border-bottom: 1px solid #ccc;
      display: flex;
      justify-content: space-between;
      .item-l {
        font-size: 13px;
        color: #666;
        margin-bottom: 14px;
        width: 75%;
        div {
          margin-bottom: 5px;
          margin-top: 5px;
        }
        div:nth-child(1) {
          font-size: 17px;
          font-weight: bold;
          color: #333;
          display: flex;
          align-items: center;
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
          img {
            width: 1.1467rem;
            height: 0.3733rem;
            margin-left: 5px;
          }
        }
        div:nth-of-type(3) {
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
        }
        .score {
          color: #faaf00;
          font-size: 15px;
          font-weight: bold;
        }
      }
      .item-r {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 20%;
        .btn {
          width: 1.44rem;
          height: 0.7467rem;
          border-radius: 1.0667rem;
          background-color: #f03d37;
          box-shadow: 0 0.04rem 0.04rem 0 rgb(240 61 55 / 15%);
          color: #fff;
          font-size: 13px;
          text-align: center;
          line-height: 0.7467rem;
        }
      }
    }
  }
}
</style>